<?php

use yii\db\Migration;

class m170504_071856_alter_student extends Migration
{
    public function up()
    {
        $this->addColumn('{{%student}}', 'birthday', $this->date(4).' default NULL comment \'出生年月\'');
        $this->addColumn('{{%student}}', 'blood_type', $this->string(10).' default NULL comment \'血型\'');
        $this->addColumn('{{%student}}', 'hobby', $this->string(200).' default NULL comment \'兴趣爱好\'');
        $this->addColumn('{{%student}}', 'father_phone', $this->string(50).' default NULL comment \'父亲电话\'');
        $this->addColumn('{{%student}}', 'father_company', $this->string(100).' default NULL comment \'父亲单位\'');
        $this->addColumn('{{%student}}', 'mother_phone', $this->string(50).' default NULL comment \'母亲电话\'');
        $this->addColumn('{{%student}}', 'mother_company', $this->string(100).' default NULL comment \'母亲单位\'');
        $this->addColumn('{{%student}}', 'school', $this->string(100).' default NULL comment \'学校/幼儿园\'');
        $this->addColumn('{{%student}}', 'address', $this->string(100).' default NULL comment \'家庭住址\'');
        $this->addColumn('{{%student}}', 'finish_studying', $this->string(100).' default NULL comment \'已学科目\'');
        $this->addColumn('{{%student}}', 'intention_studying', $this->string(100).' default NULL comment \'感兴趣科目\'');
        $this->addColumn('{{%student}}', 'source', $this->string(50).' default NULL comment \'渠道来源\'');
        $this->addColumn('{{%student}}', 'card_number', $this->string(50).' default NULL comment \'奖学金卡号\'');
        $this->addColumn('{{%student}}', 'company_type', $this->string(50).' default NULL comment \'父母公司类型\'');
        $this->addColumn('{{%student}}', 'main_contacts', $this->string(50).' default NULL comment \'第一联系人\'');
        $this->addColumn('{{%student}}', 'main_phone', $this->string(50).' default NULL comment \'第一联系人电话\'');
    }



    public function down()
    {
        $this->dropColumn('{{%student}}', 'birthday');
        $this->dropColumn('{{%student}}', 'blood_type');
        $this->dropColumn('{{%student}}', 'hobby');
        $this->dropColumn('{{%student}}', 'father_phone');
        $this->dropColumn('{{%student}}', 'father_company');
        $this->dropColumn('{{%student}}', 'mother_company');
        $this->dropColumn('{{%student}}', 'mother_phone');
        $this->dropColumn('{{%student}}', 'school');
        $this->dropColumn('{{%student}}', 'address');
        $this->dropColumn('{{%student}}', 'finish_studying');
        $this->dropColumn('{{%student}}', 'intention_studying');
        $this->dropColumn('{{%student}}', 'source');
        $this->dropColumn('{{%student}}', 'card_number');
        $this->dropColumn('{{%student}}', 'company_type');
        $this->dropColumn('{{%student}}', 'main_contacts');
        $this->dropColumn('{{%student}}', 'main_phone');
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
